package model

func (*Region) TableName() string {
	return TableRegion
}

type Region struct {
	ID       int32       `xorm:"pk autoincr not null index comment('自增ID')"`
	Name     string      `xorm:"name not null varchar(100) comment('名称')"`
	PID      int32       `xorm:"pid not null comment('父级ID')"`
	Level    RegionLevel `xorm:"default(0) comment('层等级')"`
	CityCode string      `xorm:"city_code varchar(10) comment('城市CODE')"`
	MerID    string      `xorm:"mer_ID varchar(30) comment('层级ID')"`
	MerName  string      `xorm:"mer_name varchar(255) comment('层级名称')"`
	Center   string      `xorm:"varchar(30) comment('中心经纬度')"`
}

type RegionLevel int32 // 省市区层等级

const (
	RegionLevelUnknow   RegionLevel = iota // 未知
	RegionLevelProvince                    // 省
	RegionLevelCity                        // 市
	RegionLevelDistrict                    // 区/县
)
